From: Adel Gadllah Date: Sat, 2 Mar 2013 13:59:05 +0000 (+0100) Subject: screenshot: Discard invalid sized areas X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4597 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a3f625fe397a5f7a45abe265e2baa0cc80bd5860;p=gnome-shell.git screenshot: Discard invalid sized areas https://bugzilla.gnome.org/show_bug.cgi?id=694998 --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 5537bf155..2219a890f 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -76,6 +76,11 @@ const ScreenshotService = new Lang.Class({ ScreenshotAreaAsync : function (params, invocation) { let [x, y, width, height, flash, filename, callback] = params; + if (height <= 0 || width <= 0) { + invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED, + "Invalid params"); + return; + } let screenshot = new Shell.Screenshot(); screenshot.screenshot_area (x, y, width, height, filename, Lang.bind(this, this._onScreenshotComplete,